package com.wxzz.elearing.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.user.entity.AdminRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author
 * @since 2021-03-11
 */
public interface AdminRoleMapper extends BaseMapper<AdminRole> {

    @Select("SELECT * FROM `admin_role` r JOIN admin_user_role ur ON r.id = ur.admin_role_id WHERE ur.admin_user_id = #{adminUserId} AND r.deleted = 0 AND ur.deleted = 0")
    AdminRole selectAdminRoleByAdminUserId(@Param("adminUserId")Long adminUserId);

}
